package com.rocksdata.mc.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.rocksdata.mc.entity.AppWidgetInfo;
import com.rocksdata.mc.R;

/**
 * Created by 陈堂正 on 2017/5/12.
 */

public class CampusCardWidgetView extends BaseWidgetView {
    private TextView tvBalance;

    public CampusCardWidgetView(Context context) {
        super(context);
    }

    public CampusCardWidgetView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setupHeadView() {
        ivIcon.setImageResource(R.mipmap.ic_widget_campus_card);
        tvName.setText("一卡通");
        OnClickListener listener = new OnClickListener() {
            @Override
            public void onClick(View v) {
                if(onEnterAppListener != null){
                    onEnterAppListener.onEnterApp(AppWidgetInfo.TYPE_TIMETABLE);
                }
            }
        };
        layoutHead.setOnClickListener(listener);
        layoutContent.setOnClickListener(listener);
    }

    @Override
    public View getContentView() {
        View contentView = LayoutInflater.from(mContext).inflate(R.layout.widget_campus_card, null);
        tvBalance = (TextView) contentView.findViewById(R.id.tv_campus_card_balance);
        return contentView;
    }

    @Override
    public void bindData() {

    }

    @Override
    public void release() {

    }
}
